package com.company.practice;

public class Spider extends Animal{

    public String name;
    protected int legs;

    protected Spider(int legs){
        super(legs);
        System.out.println("all spider is " + super.legs + "条腿");
    }

    @Override
    public void eat(){
        System.out.println(this.name + "正在吃");
    }

    public static void main(String[] args) {
        Spider spider = new Spider(8);
        spider.name = "蜘蛛";
        spider.eat();
    }

}
